{extend name='admin@main'}

{block name="button"}

{if auth("add")}

{/if}

{if auth("remove")}

{/if}

{/block}

{block name="content"}
{php}
{//var_dump($storememberinfo);}
{//var_dump($companyinfo);}
{//var_dump($userinfo['db2']);}
{/php}
<style type="text/css">
     .layui-icon-date{color: #656565;position: absolute; right: 10px;top: 20%;z-index: 2; font-size: 20px;}
     /*.layui-show{margin-left: 140px;}*/
     .ybimage{width: 100px !important;}
     .idcardimage{width: 100% !important; max-width: 50%;}
     .uploadimage{
      background-image: url("__ROOT__/static/theme/img/upyyzz.png");
      background-repeat: no-repeat;
      width: 140px;
      height: 140px;
     }
     .uploadimage:hover {
      cursor:pointer;
      background-image: url("__ROOT__/static/theme/img/hupyyzz.png");
     }
     .upload-image-box {
        width: 130px;
        height: 90px;
        border: 1px solid rgba(125, 125, 125, .1);
        background: url("__ROOT__/static/theme/img/yyzz.png") no-repeat center center;
        background-size: cover;
    }
    .layui-form-label{
      width: unset;
    }
    .layui-form-item{
      margin-bottom: 30px;
    }
    .form-item-p{
      line-height: 40px; height: 40px;font-size: 14px;
    }
/*    .disbale-box{
      z-index: 99999;
      opacity: 0.3;
      position: absolute;
      width: 100%;
      height: 20%;
      background-color: #bdbdbd;
      text-align: center;
    }
    .disbale-box .disbale-minbox{
      font-weight: 400;
      font-size: 4rem;
      margin: 100px;
    }*/
    .newimg_1l{border:1px solid #e6e6e6;min-height:8rem;position:relative;margin-bottom:10px;border-radius: 8px;}
    .showaddico{position: absolute;top:35%;width:100%;text-align:center;}

    .showaddico .layui-icon{font-size:2.5rem;color:#06C}
    .showaddico .uploadico_text{color:#06C;}
    .newimg_1l .thisnoimg{width:100%;text-align:center;opacity:0.5;}
    .newimg_1l .thisnoimg:hover{opacity:1;}
    .newimg_1l .thisnoimg img{height:100%}
     .newimg_1l .thisshowimg{width:100%;text-align:center;}
     .newimg_1l .thisshowimg:hover,.showaddico:hover{
      cursor:pointer;
     }
     .newimg_1l .thisshowimg img{height:100%;width: 50%;}
     .newimg_1l .delimg{position:absolute;right:5px;top:5px;z-index: 1;}
     .newimg_1l .delimg .layui-icon{font-size:1.5rem;color:#06C}
   /*  .layui-icon-delete:hover{color: red;}*/
     .auditing{

      text-align: center;
      position: absolute;
      top: 20%;
      left: 25%;
      background-color: #fff;
     }
     .auditing-dialog{
      width: 30%;
      height: 230px;
     }
     .auditing-tips{
        margin-top: 25%;
        margin-bottom: 25%;
     }
     .auditing-tips .auditing-sm-box{
        
     }
     .container-auditing-box{display: none;}
     #layui-icon-close-fill{transform:rotate(45deg);}
</style>
<div class="think-box-shadow" style="height: 100%">
{php}
{//var_dump($companyinfo);}
{/php}
<div class="layui-container container-auditing-box">
  
    <div class="layui-row">

    <div class="layui-col-md12">
      
      <div class="auditing-tips text-center">
        <div class="auditing-sm-box">
      <i class="layui-icon" style="font-size: 100px; color: #f3f3f3;">&#xe6b2;</i>  
      <p class="font-w6 font-s16 margin-right-10">审 核 中</p>
    </div>
    </div>
    </div>
    </div>

</div>
<div class="layui-container container-big-box">  
  
  <div class="layui-row">

    <div class="layui-col-md8">

  <div class="layui-tab-content">
    <!--{if $companyinfo['status'] ==0}-->
    <!--<div class="disbale-box">-->
    <!--  <div class="disbale-minbox">-->
    <!--  <h2>审 核 中</h2>-->
    <!--</div>-->
    <!--</div>-->
    <!--{/if}-->
    <div class="layui-tab-item layui-show">

<form id="companycard-form" action="{:url('personal/upload')}" onsubmit="return false;"  method="post" enctype="multipart/form-data">

  <div class="layui-card-body padding-left-40">
      


<div class="layui-form-item">
 
</div>
 <div class="layui-col-md12">
      <div class="text-left">
      <h1>公司信息</h1>
        <hr>
    </div>
     <div class="layui-form-item">
    <label class="layui-form-label font-w7">公司名称</label>
    <div class="layui-input-block">
      <div class="form-item-p">
      {if @$companyinfo}

      <p>{$companyinfo['name']|default=''}</p>
      <!--   <input readonly type="text" name="title" required  lay-verify="required" value="{$companyinfo['name']|default=''}" autocomplete="off" class="layui-input">
 -->
      {else}
        <input readonly type="text" name="title" required  lay-verify="required"  autocomplete="off" class="layui-input">
      {/if}
      </div>
    </div>
  </div>
       <div class="layui-form-item">
    <label class="layui-form-label font-w7">公司负责人</label>
    <div class="layui-input-block">
      <div class="form-item-p">
              {if @$companyinfo}
                <p>{$companyinfo['corporation']|default=''}</p>
               <!--  <input readonly type="text" name="corporation" required  lay-verify="required"  value="{$companyinfo['corporation']|default=''}" autocomplete="off" class="layui-input"> -->
              {else}
                              {if @$storememberinfo}
               <input readonly type="text" name="username" required  lay-verify="required"  value="{$storememberinfo['username']|default=''}" autocomplete="off" class="layui-input">
              {/if}
              {/if}
      </div>

      
    </div>
  </div>
         <div class="layui-form-item">
    <label class="layui-form-label font-w7">联系电话</label>
    <div class="layui-input-block">
      <div class="form-item-p">
              {if @$companyinfo}
                {if $companyinfo['company_mobile']}
                <p>{$companyinfo['company_mobile']|default='-'}</p>
                {else}
                   {if @$userinfo['db2']}
                          {$userinfo['db2']['mobile']|default=''}
                {/if}
                {/if}
   <!--              <input readonly type="text" pattern="^1[3-9][0-9]{9}$" name="company_mobile" required  lay-verify="required"  value="{$companyinfo['company_mobile']|default='-'}" autocomplete="off" class="layui-input"> -->
              {else}
                   {if @$userinfo['db2']}
                 {$userinfo['db2']['mobile']|default=''}
                {/if}
              {/if}
      </div>
    </div>
  </div>
     <div class="layui-form-item">
    <label class="layui-form-label font-w7">社会信用代码</label>
    <div class="layui-input-block">
      <div class="form-item-p">
              {if @$companyinfo}
                {$companyinfo['code']|default=''}
               <!--  <input readonly type="text" name="code"   lay-verify="required"  value="{$companyinfo['code']|default=''}" autocomplete="off" class="layui-input"> -->
             
              {else}
                <input readonly type="text" name="code"   lay-verify="required" autocomplete="off" class="layui-input">
              {/if}
      </div>
    </div>
  </div>

       <div class="layui-form-item">
    <label class="layui-form-label font-w7">公司地址</label>
    <div class="layui-input-block">
      <div class="form-item-p">
              {if @$companyinfo}
                {$companyinfo['address']|default=''}
         <!--        <input readonly type="text" name="address" required  lay-verify="required"  value="{$companyinfo['address']|default=''}" autocomplete="off" class="layui-input"> -->
              {else}
                <input readonly type="text" name="address" required  lay-verify="required"autocomplete="off" class="layui-input">
              {/if}
        </div>
    </div>
  </div>

<!-- 身份证件- -开始 -->
<!-- <div class="text-left">
      <h1>身份证件信息</h1>
        <hr>
    </div> -->
<div class="layui-form-item" style="display: none;">
    <div class="layui-col-md12">
     <div class="layui-form-item">
    <label class="layui-form-label label-required">身份证件</label>
    <div class="layui-input-block">
        <div class="newimg_1l" id="idcarz">
            <div  style="display: none;">
                       <input name="uploadidcardz" type="hidden" value="{$vo.logo|default=''}">
          <script>$('[name="uploadidcardz"]').uploadOneImage()</script>
            </div>
            <!--删除按钮-->
            <div class="delimg"> 
                <i class="layui-icon layui-icon-delete"></i>
            </div>
            <!--有图片状态-->
           
           <!--没有图片状态-->
        
          
                {if @$userinfo['db2']['imgurl']}
                {php}

                   {
                  //路径1
                    if (strstr($userinfo['db2']['imgurl'],'http://pc.zsicp.com')){
                        echo  "<div id='normalupimg' class='thisshowimg'> <img data-tips-image class='idcardimage' src=".$userinfo['db2']['imgurl']."></div>";
                    }else{
                  //路径2
                        echo "<div id='normalupimg' class='thisshowimg'><img data-tips-image class='idcardimage' data-tips-image src="."http://devs.zsicp.com/public/upload/business_license/".$userinfo['db2']['imgurl']."></div>";   
                    }
                
                    }
                {/php}

                {else}
                <!-- none --> 
                <div id='normalupimg' class='thisnoimg gray'><img data-tips-image class='ybimage' src='__ROOT__/static/theme/img/sfzybf.png'></div>
            {/if}
    
    
        
           <!--上传按钮-->
           <div class="showaddico">
               <div id="layui-icon-close-fill">
               <i class="layui-icon layui-icon-close-fill"></i>
             </div>
               <div class="uploadico_text padding-top-10">
                   请上传证件照正面
               </div>
           </div>
        </div>
        <div>请JPG，PNG，BMP，GIF格式。</div>
    </div>

<!-- -----反面 -->
<div class="maing-top-10"></div>
<!-- 反面 -->
   <div class="layui-input-block">
        <div class="newimg_1l" id="idcarf">
            <div  style="display: none;">
                       <input name="uploadidcardf" type="hidden" value="{$vo.logo|default=''}">
          <script>$('[name="uploadidcardf"]').uploadOneImage()</script>
            </div>
            <!--删除按钮-->
            <div class="delimg"> 
                <i class="layui-icon layui-icon-delete"></i>
            </div>
            <!--有图片状态-->
           
           <!--没有图片状态-->
        
          
                {if @$userinfo['db2']['imgurl']}
                {php}

                   {
                  //路径1
                    if (strstr($userinfo['db2']['imgurl'],'http://pc.zsicp.com')){
                        echo  "<div id='normalupimg' class='thisshowimg'> <img data-tips-image class='idcardimage' src=".$userinfo['db2']['imgurl_b']."></div>";
                    }else{
                  //路径2
                        echo "<div id='normalupimg' class='thisshowimg'><img data-tips-image class='idcardimage' data-tips-image src="."http://devs.zsicp.com/public/upload/business_license/".$userinfo['db2']['imgurl_b']."></div>";   
                    }
                
                    }
                {/php}

                {else}
                <!-- none --> 
                <div id='normalupimg' class='thisnoimg gray'><img data-tips-image class='ybimage' src='__ROOT__/static/theme/img/sfzybz.png'></div>
            {/if}
    
    
        
           <!--上传按钮-->
           <div class="showaddico">
               <div id="layui-icon-close-fill">
               <i class="layui-icon layui-icon-close-fill"></i>
             </div>
               <div class="uploadico_text padding-top-10">
                   请上传证件照反面
               </div>
           </div>
        </div>
        <div>请JPG，PNG，BMP，GIF格式。</div>
        <div>为避免审核失败,请上传清晰、平铺、无反光、无遮边的证件照片</div>
    </div>


  </div>
 </div>
  
  
</div>
 <div class="layui-col-md12">
      <div class="text-left">
      <h1>管理员信息</h1>
        <hr>
    </div>
     <div class="layui-form-item">
    <label class="layui-form-label font-w7">真实姓名</label>
    <div class="layui-input-block">
      {if @$userinfo['db2']}
      <div class="form-item-p">
        {$userinfo['db2']['name']|default=''}
      </div>
     <!--    <input readonly type="text" name="name" required  lay-verify="required" value="{$userinfo['db2']['name']|default=''}" autocomplete="off" class="layui-input"> -->
      {else}
        <input placeholder="真实姓名" readonly type="text" name="name" required  lay-verify="required"  autocomplete="off" class="layui-input">
      {/if}
      
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label font-w7">性别</label>
    <div class="layui-input-block">
        <div class="form-item-p">
        {if $userinfo['db2']}
        {switch name="userinfo.db2.sex" }
           {case value='0'}<i class="layui-icon" style="font-size: 32px;color:#FFB800 "></i>未知</a>{/case}
           {case value='1'}<i class="layui-icon" style="font-size: 32px;color:#009688 "></i>男</a>{/case}
           {case value='2'}<i class="layui-icon" style="font-size: 32px;color:#FF5722 "></i>女</a>{/case}
           {default/}未知
        {/switch}
        {/if}
      </div>
    </div>
  </div>

       <div class="layui-form-item">
    <label class="layui-form-label font-w7">证件类型</label>
    <div class="layui-input-block">
      <div class="form-item-p">
          <p>居民身份证</p>
      </div>
          
    </div>
  </div>

       <div class="layui-form-item">
    <label class="layui-form-label font-w7">证件号码</label>
    <div class="layui-input-block">
              {if @$userinfo['db2']}
                <div class="form-item-p">{$userinfo['db2']['identitycard']|default=''}</div>
        <!--         <input placeholder="证件号码" readonly type="text" name="identitycard" required  lay-verify="required"  value="{$userinfo['db2']['identitycard']|default=''}" autocomplete="off" class="layui-input"> -->
              {else}
               <input placeholder="证件号码" readonly type="text" name="identitycard" required  lay-verify="required"  value="" autocomplete="off" class="layui-input">
              {/if}
    </div>
  </div>
         <div class="layui-form-item">
    <label class="layui-form-label font-w7">出生日期</label>
    <div class="layui-input-block">
          {if @$userinfo['db2']}
             <div class="form-item-p">
                <p>{$userinfo['db2']['birthday']|default=''}</p>
              </div>
            <!--     <input type="text" class="layui-input" id="birth" name="birthday" value="
                  ">      --> 
          {else}
                <input type="text" class="layui-input" id="birth" name="birthday" value="{$Think.get.birthday|default=''}"  placeholder="请选择出生日期">      
          {/if}
            </div>

    </div>

         <div class="layui-form-item">
    <label class="layui-form-label font-w7">证件有效日期</label>
    <div class="layui-input-block">

        {switch name="userinfo.db2.idcard_date_type" }
           {case value='1'}<i class="layui-icon" style="font-size: 32px;color:#009688 "></i>
          有效期限
           <!-- {$userinfo['db2']['idcard_date_begin']} -- {$userinfo['db2']['idcard_date_end']} -->
         </a>{/case}
           {case value='2'}<i class="layui-icon" style="font-size: 32px;color:#FF5722 "></i>无限期,长期有效 </a>{/case}
           {default/}未知
        {/switch}


            </div>

    </div>

    {if $userinfo['db2']['idcard_date_type'] == 1}
             <div class="layui-form-item">
    <label class="layui-form-label font-w7">证件起始日期</label>
    <div class="layui-input-block">
          {if @$userinfo['db2']}
          <div class="form-item-p">
          {$userinfo['db2']['idcard_date_begin']}
        </div>
               <!--  <input disabled type="text" class="layui-input" id="idcard_date1" name="idcard_date1" value="{$userinfo['db2']['idcard_date_begin']|default=''}"><i class="layui-icon layui-icon-date"></i>         -->
          {else}
                <input disabled type="text" class="layui-input" id="idcard_date1" name="idcard_date1" value="{$Think.get.birthday|default=''}"  placeholder="选择证件起始日期"><i class="layui-icon layui-icon-date"></i>        
          {/if}
            </div>

    </div>


             <div class="layui-form-item">
    <label class="layui-form-label font-w7">证件截止日期</label>
    <div class="layui-input-block">
          {if @$userinfo['db2']}
        <div class="form-item-p">
          {$userinfo['db2']['idcard_date_end']}
        </div>
                <!-- <input disabled type="text" class="layui-input" id="idcard_date2" name="idcard_date2" value="{$userinfo['db2']['idcard_date_end']|default=''}"><i class="layui-icon layui-icon-date"></i>   -->      
          {else}
                <input disabled type="text" class="layui-input" id="idcard_date2" name="idcard_date2" value="{$Think.get.birthday|default=''}"  placeholder="选择证件截止日期"><i class="layui-icon layui-icon-date"></i>   
          {/if}
            </div>

    </div>
    {/if}

  </div>

<!-- 授权书--开始 -->
<div class="layui-form-item" style="display: none;">
    <div class="layui-col-md12">
     <div class="layui-form-item">
    <label class="layui-form-label font-w7">授权书</label>
    <div class="layui-input-block">

        <div class="newimg_1l" id="newimg_sqs">

            <!--删除按钮-->
   
            <!--有图片状态-->
           
           <!--没有图片状态-->
                {if @$companyinfo['warrant']}

                <div id="normalupimg" class='thisshowimg'> <img data-tips-image class='ybimage' src="{$companyinfo['warrant']}"></div>
                {else}
                <!-- none --> 
                <div id="normalupimg" class='thisnoimg'><img data-tips-image class='ybimage' src='__ROOT__/static/theme/img/yb.png'></div>
            {/if}
               <!--上传按钮-->
           <div class="showaddico">
               
               <i class="layui-icon layui-icon-add-circle "></i>
               <div class="uploadico_text padding-top-10">
                   传授权书
               </div>

           </div>
        </div>
        <div>请上传JPG，PNG，BMP，GIF格式。</div>
        <div><a href="javascript:;">下载授权书模板</a></div>
    </div>
  </div>
 </div>

  </div>

    <input type='hidden' value='update' name='companycardtype'>
     <div class="layui-form-item">
    <div class="layui-input-block">
      <span style="color: #FF5722;">提交后耐心等待至认证通知</span>
      <br>
   {if $companyinfo['status'] !=0}
      <button class="layui-btn companycardsub-btn layui-btn-normal" data-open="{:url('company/company/companycenter')}?type=update">重新认证</button>
    <!--  <button class="layui-btn layui-btn-normal companycardupdate-btn" lay-filter="upformDemo">修 改</button> -->
     {/if}
    </div>
  </div>


</div>
</form>

</div>
<!--     <div class="layui-tab-item">4</div>
    <div class="layui-tab-item">5</div>
    <div class="layui-tab-item">6</div> -->
  </div>
    </div>
  </div>
<!-- end 左边主体 -->
<!-- start 右边主体 -->
 <div class="layui-col-md3 margin-right-20" style="margin-top: 100px;">
  <!-- 营业执照 -->
     <div class="layui-form-item">
    <div class="layui-col-md12">
     <div class="layui-form-item">
    <div class="layui-input-block">

        <div class="newimg_1l" id="newimg_yyzz">

            <!--删除按钮-->

            <!--有图片状态-->
      
           <!--没有图片状态-->

                {if @$companyinfo['imgurl']}
                {php}
                //var_dump($companyinfo['imgurl']);
                   {
                  //路径1
                    if (strstr($companyinfo['imgurl'],'http://pc.zsicp.com')||strstr($companyinfo['imgurl'],'http://devs.zsicp.com')){
                        echo  "<div id='normalupimg' class='thisshowimg'> <img data-tips-image class='ybimage' src=".$companyinfo['imgurl']."></div>";
                    }else{
                  //路径2
                        echo "<div id='normalupimg' class='thisshowimg'><img data-tips-image class='ybimage' data-tips-image src="."http://devs.zsicp.com/public/upload/business_license/".$companyinfo['imgurl']."></div>";   
                    }
                
                    }
                {/php}

                {else}
                <!-- none --> 
                <div id='normalupimg' class='thisnoimg'><img data-tips-image class='ybimage' src='__ROOT__/static/theme/img/yb.png'></div>
            {/if}
  
        </div>
        <div class="text-center">营业执照</div>
    </div>
  </div>
 </div>  
</div>


<!-- 授权书 -->
<div class="layui-form-item">
    <div class="layui-col-md12">
     <div class="layui-form-item">
<!--     <label class="layui-form-label label-required">上传授权书</label> -->
    <div class="layui-input-block">
        <div class="newimg_1l" id="newimg_sqs">

            <!--有图片状态-->
           
           <!--没有图片状态-->
                {if @$companyinfo['warrant']}

                <div id="normalupimg" class='thisshowimg'> <img data-tips-image class='ybimage' src="{$companyinfo['warrant']}"></div>
                {else}
                <!-- none --> 
                <div id="normalupimg" class='thisnoimg'><img data-tips-image class='ybimage' src='__ROOT__/static/theme/img/yb.png'></div>
            {/if}
               <!--上传按钮-->
           <div class="showaddico">
               
               <i class="layui-icon layui-icon-add-circle "></i>
               <div class="uploadico_text padding-top-10">
                   授权书
               </div>

           </div>
        </div>
        <div>上传授权书</div>
       <!--  <div><a href="javascript:;">下载授权书模板</a></div> -->
    </div>
  </div>
 </div>

  </div>


<!-- 分割线 -->
<!-- <div class="layui-form-item margin-top-40">
  
  <div class="layui-form-item margin-top-40">&nbsp;&nbsp;</div>
  <div class="layui-form-item margin-top-40">&nbsp;&nbsp;</div>
</div> -->
<!-- 身份证件 -->
<div class="layui-form-item margin-top-40">
    <div class="layui-col-md12">
     <div class="layui-form-item">
    <!-- <label class="layui-form-label label-required">身份证件</label> -->
    <div class="layui-input-block">
        <div class="newimg_1l" id="idcarz">

            <!--删除按钮-->
  
            <!--有图片状态-->
           
           <!--没有图片状态-->
        
          
                {if @$userinfo['db2']['imgurl']}
                {php}

                   {
                  //路径1
                    if (strstr($userinfo['db2']['imgurl'],'http://devs.zsicp.com')||strstr($userinfo['db2']['imgurl'],'http://pc.zsicp.com')){
                        echo  "<div id='normalupimg' class='thisshowimg'> <img data-tips-image class='idcardimage' src=".$userinfo['db2']['imgurl']."></div>";
                    }else{
                  //路径2
                      if($userinfo['db2']['imgurl']!='user/userlogo.png'){

                        echo "<div id='normalupimg' class='thisshowimg'><img data-tips-image class='idcardimage' data-tips-image src="."http://devs.zsicp.com/public/upload/idcard/".$userinfo['db2']['imgurl']."></div>";   
                      }else{

                        echo "<div id='normalupimg' class='thisnoimg gray'><img data-tips-image class='thisnoimg ybimage' src='__ROOT__/static/theme/img/sfzybf.png'></div>";
                      } 
                    }
                
                    }
                {/php}

                {else}
                <!-- none --> 
                <div id='normalupimg' class='thisnoimg gray'><img data-tips-image class='ybimage' src='__ROOT__/static/theme/img/sfzybf.png'></div>
            {/if}
    
    
        
           <!--上传按钮-->

        </div>
        <div>身份证正面</div>
    </div>

<!-- -----反面 -->
<div class="maing-top-10"></div>
<!-- 反面 -->
   <div class="layui-input-block">
        <div class="newimg_1l" id="idcarf">

            <!--删除按钮-->
  
            <!--有图片状态-->
           
           <!--没有图片状态-->
        
          
                {if @$userinfo['db2']['imgurl_b']}
                {php}

                   {
                  //路径1
                    if (strstr($userinfo['db2']['imgurl_b'],'http://devs.zsicp.com') || strstr($userinfo['db2']['imgurl_b'],'http://pc.zsicp.com')){
                        echo  "<div id='normalupimg' class='thisshowimg'> <img data-tips-image class='idcardimage' src=".$userinfo['db2']['imgurl_b']."></div>";
                    }else{
                  //路径2
                      if($userinfo['db2']['imgurl_b']!='user/userlogo.png'){

                        echo "<div id='normalupimg' class='thisshowimg'><img data-tips-image class='idcardimage' data-tips-image src="."http://devs.zsicp.com/public/upload/idcard/".$userinfo['db2']['imgurl_b']."></div>";   
                      }else{

                        echo "<div id='normalupimg' class='thisnoimg gray'><img data-tips-image class='thisnoimg ybimage' src='__ROOT__/static/theme/img/sfzybf.png'></div>";
                      }
                    }
                
                    }
                {/php}

                {else}
                <!-- none --> 
                <div id='normalupimg' class='thisnoimg gray'><img data-tips-image class='ybimage' src='__ROOT__/static/theme/img/sfzybz.png'></div>
            {/if}
    
    
        
           <!--上传按钮-->
           <div class="showaddico">
               <div id="layui-icon-close-fill">
               <i class="layui-icon layui-icon-close-fill"></i>
             </div>
               <div class="uploadico_text padding-top-10">
                   请上传证件照反面
               </div>
           </div>
        </div>
        <div>证件照反面</div>
       <!--  <div>为避免审核失败,请上传清晰、平铺、无反光、无遮边的证件照片</div> -->
    </div>


  </div>
 </div>
  
  
</div>

<!-- 分割线 -->
<div class="layui-form-item margin-top-40">

</div>


    </div>

<!-- <div class="auditing layui-anim-fadein">
  <div class=""><i class="layui-icon" style="font-size: 10px; color: #1E9FFF;">&#x1006;</i> </div>
  <h2 class="font-w7">营业执照审核</h2>
  <p class="margin-20 font-s12">您已提交营业执照审核申请,我们将在1-3个工作日内审核。</br> 审核通过后您可直接登录系统,如审核不通过,请修改信息后提交</p>
</div>
 -->
</div>

<script type="text/javascript">
      layui.use(['laydate','form'], function(){
      var laydate = layui.laydate;
          var form = layui.form;
        var  layer = layui.layer;
          laydate.render({elem: '#birth'});
          laydate.render({elem: '#idcard_date1'});
          laydate.render({elem: '#idcard_date2'});

        });
      require(['angular', 'ckeditor'], function () {
        var iconlist = []
        $.post("{:url('admin/index/imagelist')}",{}, function(result) {
            iconlist = result.data
        });
        //检测信息完整度
        $.post("{:url('company/company/ajaxcompanycenter')}",{},function(result){
           if(result.data.companyinfo){
            var ajax_companyinfo =  result.data.companyinfo

            Object.keys(ajax_companyinfo).forEach(function(key){
                console.log(key,ajax_companyinfo[key])
                //检测公司图片
                if(key=='imgurl'){
                  if(ajax_companyinfo[key]=='http://pc.zsicp.com/static/theme/img/404_icon.png' || ajax_companyinfo[key]==""){
                    $.msg.confirm('您当前信息还不完善,请重新认证避免影响使用',
                      function(ok){
                          $('.companycardsub-btn').click();
                            layer.close(ok);
                    },function(canel){


                    });
                  }
                }
            });

           }
        });

        var $form = $('form[name="news"]');
        var $vali = $form.vali().data('validate');
        // var editor = window.createEditor('[name="content"]');

        var app = angular.module("NewsEditor", []).run(callback);
        angular.bootstrap(document.getElementById(app.name), [app.name]);

        //检测审核
        var companyinfo = eval("{$companyinfo['id']}")
        //身份证件检测
        var personinfo = eval("{$userinfo['db2']['id']}")
        if(personinfo){
          //
          var idcarz_is = "{$userinfo['db2']['imgurl']}"
          var idcarf_is = "{$userinfo['db2']['imgurl_b']}"
          if(idcarz_is!="" || idcarf_is!=""){
            $('#idcarz .showaddico').css({'display':'none'})
            $('#idcarf .showaddico').css({'display':'none'})
            $('.personcardsub-btn').css({'display':'none'})
          }
          //检测图片
          var companyinfo_yyzz_img = "{$userinfo['db2']['imgurl']}"
          if(companyinfo_yyzz_img){
            $('#newimg_yyzz .showaddico').css({'display':'none'})
          }
        }
        if(companyinfo){
          //坚持审核
          var is_auditing = eval("{$companyinfo['status']}")
          if(is_auditing===0){
            $('.container-auditing-box').css({'display':'block'})
            $('.container-big-box').css({'display':'none'})

        var auditing_str =    '<div class="auditing layui-anim-fadein">'+
        '<h2 class="font-w7">营业执照审核</h2>'+
        '<p class="margin-20 font-s12">您已提交营业执照审核申请,我们将在1-3个工作日内审核。</br> 审核通过后您可直接登录系统,如审核不通过,请修改信息后提交</p>'+
        '</div>';

       layer.confirm(auditing_str, {
          area: ['700px', '240px'],
    // icon: 1, 
          title:'提示'}, function(index){
  //do something
  
          layer.close(index);
        });
          }
          //检测图片
          var companyinfo_yyzz_img = "{$companyinfo['imgurl']}"
          if(companyinfo_yyzz_img){
            $('#newimg_yyzz .showaddico').css({'display':'none'})
          }
          //检测授权书
          var companyinfo_sqb_img = "{$companyinfo['warrant']}"
          if(companyinfo_sqb_img){
            $('#newimg_sqs .showaddico').css({'display':'none'})
          }
        }

        //上传按钮
        $('.showaddico').on('click',function(){
            var fater_parent = $(this).parent().attr('id')
            console.log(fater_parent)
            $('#'+fater_parent+' .uploadimage').click();
            // //营业执照
            // if(fater_parent =='newimg_yyzz'){
            //  $('#'+fater_parent+' .uploadimage').click();
            // }
            // //身份证正面
            // if(fater_parent =='idcarf'){
            //  $('#'+fater_parent+' .uploadimage').click();
            // }
            // //身份证反面
            // if(fater_parent =='idcarz'){
            //   $('#'+fater_parent+' .uploadimage').click();
            // }   
            // //授权书
            // if(fater_parent =='newimg_sqs'){
            //   $('#'+fater_parent+' .uploadimage').click();
            // }            

        });

        //删除按钮
        $('.delimg').on('click',function(){
          console.log(iconlist)
            var fater_parent = $(this).parent().attr('id')
            if(fater_parent.search("idcar") != -1 ){
            //身份证件
              return $.msg.confirm('删除并重新上传身份证件?',function(okres){
                $('#'+fater_parent+' #normalupimg img').removeClass('thisnoimg')
                $('#'+fater_parent+' #normalupimg img').removeClass('thisshowimg')
                $('#'+fater_parent+' #normalupimg img').removeClass('ybimage')
                $('#'+fater_parent+' #normalupimg img').removeClass('idcardimage')
                $('#'+fater_parent+' #normalupimg img').attr('src','')
                //反面
                if(fater_parent =='idcarf'){
                  
                  $('#'+fater_parent+' #normalupimg img').css('opacity',0)
                  $('#'+fater_parent+' #normalupimg').css({"background-image":"url('"+iconlist[2].base_img+"')",
                      'background-repeat':'no-repeat',
                      'background-size':'100%',
                      'height':'260px',

                })

                  $('input[name="uploadidcardf"]').val('')
                }
                //正面
                if(fater_parent =='idcarz'){
                     $('#'+fater_parent+' #normalupimg img').css('opacity',0)
                     $('#'+fater_parent+' #normalupimg').css({"background-image":"url('"+iconlist[1].base_img+"')",
                      'background-repeat':'no-repeat',
                      'background-size':'100%',
                      'height':'260px',

                })
                  $('input[name="uploadidcardz"]').val('')
                    $(':input','#personcard-form').not(':button,:submit,:reset,:hidden').val('').removeAttr('checked'). removeAttr('checked')
                }   
              
                  $('#'+fater_parent+' #normalupimg img').addClass('thisnoimg')
                  $('#'+fater_parent+' #normalupimg img').addClass('ybimage')
                  $('#'+fater_parent+' .showaddico').css({'display':'block'})
                  //手动关闭 全局没
                  $.msg.close(okres);
              });
            }
            //
            if(fater_parent.search("newimg") != -1 ){
              return $.msg.confirm('删除并重新上传营业执照?',function(okres){
                $('#'+fater_parent+' #normalupimg img').removeClass('thisnoimg')
                $('#'+fater_parent+' #normalupimg img').removeClass('thisshowimg')
                $('#'+fater_parent+' #normalupimg img').removeClass('ybimage')
  
  
                if(fater_parent =='newimg_yyzz'){
                  $('#'+fater_parent+' #normalupimg img').attr('src',"__ROOT__/static/theme/img/yb.png")
                  $('#'+fater_parent+' #normalupimg img').css('opacity',0)
                  $('#'+fater_parent+' #normalupimg').css({"background-image":"url('"+iconlist[0].base_img+"')",
                      'background-repeat':'no-repeat',
                      'background-size':'50%',
                      'height':'260px',
                      'background-position': 'center',

                })
                }
                //授权书
                if(fater_parent =='newimg_sqs'){
                  $('#'+fater_parent+' #normalupimg img').attr('src',"")
                }   
              
                  $('#'+fater_parent+' #normalupimg img').addClass('thisnoimg')
                  $('#'+fater_parent+' #normalupimg img').addClass('ybimage')
                  $('#'+fater_parent+' .showaddico').css({'display':'block'})
                  //手动关闭 全局没
                  $.msg.close(okres);
              });            
            }

        })
        //监听修改按钮
        $('.companycardupdate-btn').on('click',function(){
            //营业执照
            $("input[name='company_mobile']").attr('readOnly',false)
            $("input[name='phone']").attr('readOnly',false)
            $('input[name="address"]').attr('readOnly',false)
            $('input[name="corporation"]').attr('readOnly',false)
            $('input[name="code"]').attr('readOnly',false)
            $('input[name="title"]').attr('readOnly',false)
            //身份证
            $('.personcardsub-btn').css({'display':'unset'})
            $("input[name='name']").attr('readOnly',false).focus()
            $('input[name="identitycard"]').attr('readOnly',false)
            
          });
        //身份证反面监听
        $('input[name="uploadidcardf"]').change(function(res){
          console.log(res.target.defaultValue)
          $('#idcarf #normalupimg img').attr('src',$('input[name="uploadsq"]').val())
          //待上传接口
          $('#idcarf #normalupimg img ').attr('src',res.target.defaultValue)
          $('#idcarf #normalupimg img').css('opacity',1)
          $('#idcarf .showaddico').css({'display':'none'})
          $('#idcarf #normalupimg img').removeClass('ybimage')
          $('#idcarf #normalupimg img').removeClass('thisnoimg')
          $('#idcarf #normalupimg img').addClass('idcardimage')

        });
        //身份证正面监听
        $('input[name="uploadidcardz"]').change(function(res){
          console.log(res)
          postData = {};
          var imgurlvalue = $('input[name="uploadidcardz"]').val()

          var companyinfoid = eval('{$userinfo["db2"]["id"]}')

          if(companyinfoid){ }
            
           
            
            postData['uptype'] = 'url';
            postData['url'] = imgurlvalue;
            gorqeuest('idcarz',postData)
            console.log(postData)

          })
        //监听授权书上传组件
        $('input[name="uploadsq"]').change(function(res){
          console.log(res)
          $('#newimg_sqs #normalupimg img').attr('src',$('input[name="uploadsq"]').val())
          $('#newimg_sqs .showaddico').css({'display':'none'})
        });
        //监听营业执照上传组件
        $('input[name="uploadyyzz"]').change(function(res){
          postData = {};
          var imgurlvalue = $('input[name="uploadyyzz"]').val()

          var companyinfoid = eval('{$companyinfo["id"]}')

          if(companyinfoid){
            
            postData['type'] = 'update';
          }
            postData['local_url'] = imgurlvalue;


          $.post("{:url('personal/personal/upload')}",postData , function(result) {
            if(typeof(result)=='string'){
              result = JSON.parse(result)
            }
            
            console.log(result)
            if (result.code == 200) {
                //成功
                $('input[name="title"]').val(result.data.name)
                $('input[name="code"]').val(result.data.code)
                $('input[name="address"]').val(result.data.address)
                $('input[name="corporation"]').val(result.data.corporation)
                $('#NewsEditor img').attr('src',result.src)

                $('.ybimage').attr('src',result.src)
                $('.showaddico').css({'display':'none'})
                $('#uploadyb').removeClass('thisnoimg')
                $('#uploadyb').addClass('thisshowimg')

                return $.msg.success(result.message);
            } else if (result.code == 400) {
                // 失败
                return $.msg.error(result.message);
            }
                }, "JSON");
          })
        //监听开关
        form.on('switch(ye_switch)', function(data){
            console.log(data.elem); //得到checkbox原始DOM对象
        // 　　console.log(data.elem.checked); //开关是否开启，true或者false
        // 　　console.log(data.value); //开关value值，也可以通过data.elem.value得到
        // 　　console.log(data.othis); //得到美化后的DOM对象
            if(data.elem.checked){

                $('.upload_yye').css({'display':'none'});
             }else{
                $('.upload_yye').css({'display':'block'});
                }
        });
        $("input[name='type']").change(function(data){
           var radioval = $('input[name="type"]:checked').val();
           console.log(radioval)
           if(radioval == 2 || radioval == 3 ){
                $('#ch-company-type').css({'display':'none'});
           }else{
                $('#ch-company-type').css({'display':'block'});
           }

        })
        /**公司信息提交**/
        $('.companycardsub-btn').on('click',function(){
          return 

        })
        //tpl  id = xxx requestdata 请求数据
        function gorqeuest(tpl,requestdata){
          $.msg.loading('验证中...')
          $.post("{:url('admin/user/upload_postidcard')}",requestdata , function(result) {
            if(typeof(result)=='string'){
              result = JSON.parse(result)
            }
            
            console.log(result)
            if (result.code == 200) {
                //成功
                if(tpl=='idcarz'){
                  console.log(result)
                  $('#idcarz #normalupimg img ').attr('src',result.data.src)
                  $('#idcarz #normalupimg img').css('opacity',1)
                  $('#idcarz .showaddico').css({'display':'none'})
                  $('#idcarz .showaddico').css({'display':'none'})
                  $('#idcarz #normalupimg img').removeClass('ybimage')
                  $('#idcarz #normalupimg img').removeClass('thisnoimg')
                  $('#idcarz #normalupimg img').addClass('idcardimage')

                  $('input[name="name"]').val(result.data.name)
                  $(".select-sex").val(result.data.sex=='男'?1:2)
                  console.log(result.data.sex=='男'?1:2)
                  //$('input[name="sex"]').val(result.data.sex=='男'?1:2)
                  $('input[name="identitycard"]').val(result.data.identitycard)

                  $('input[name="birthday"]').val(result.data.birth)
                  $('input[name="card_type"]').val('居民身份证')



                }
                if(tpl=='idcarf'){

                }
                // $('input[name="title"]').val(result.data.name)
                // $('input[name="code"]').val(result.data.code)
                // $('input[name="address"]').val(result.data.address)
                // $('input[name="corporation"]').val(result.data.corporation)
                // $('#NewsEditor img').attr('src',result.src)

                // $('.ybimage').attr('src',result.src)
                // $('.showaddico').css({'display':'none'})
                // $('#uploadyb').removeClass('thisnoimg')
                // $('#uploadyb').addClass('thisshowimg')

                return $.msg.success(result.info);
            } else if (result.code == 400) {
                // 失败
                return $.msg.error(result.info);
            }
                }, "JSON");
        }
        //
        function callback($rootScope) {
            $rootScope.list = [];
            $rootScope.item = {};

            $rootScope.setItemValue = function (name, value) {
                $rootScope.item[name] = value;
                $rootScope.item.style = "background-image:url('" + $rootScope.item.local_url + "')";
                  };

            $('[name="local_url"]').on('change', function () {
                var value = this.value;
                $rootScope.$apply(function () {
                    $rootScope.setItemValue('local_url', value);
                });
            });
        }
    });
</script>

{/block}
